import * as moment from 'moment';

/**
 * @Author: laotongshu
 * @Date: 2022-10-13 10:23:22
 * @LastEditors: laotongshu
 * @Description: 时间格式化
 * @param date: 时间
 * @param isDue: 是否显示时分秒
 * @return Date
 */
export const formatDate = (date: string | number, isDue = false) => {
  return isDue ? moment(date).format('YYY-MM-DD HH:mm:ss') : moment(date).format('YYY-MM-DD');
};
